package com.hxkj.dao.impl;

import com.hxkj.dao.FriendlyLinkDao;
import com.hxkj.mapper.FriendlyLinkMapper;
import com.hxkj.domain.po.FriendlyLink;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;


/**
* 数据操作实现
*
* @author: chenwei
* @version: 1.0
* @datetime: 2018-06-05 19:32:55
*
*/
@Service("friendlyLinkDao")
public class FriendlyLinkDaoImpl implements FriendlyLinkDao {

    @Resource
    private FriendlyLinkMapper friendlyLinkMapper;

    @Override
    public FriendlyLink get(Long linkId) {
        return friendlyLinkMapper.selectByPrimaryKey(linkId);
    }

    @Override
    public List<FriendlyLink> get(FriendlyLink friendlyLink) {
        return friendlyLinkMapper.select(friendlyLink);
    }

    @Override
    public int delete(Long linkId) {
        return friendlyLinkMapper.deleteByPrimaryKey(linkId);
    }

    @Override
    public int delete(FriendlyLink friendlyLink) {
        return friendlyLinkMapper.delete(friendlyLink);
    }

    @Override
    public int save(FriendlyLink friendlyLink) {
        return friendlyLinkMapper.insert(friendlyLink);
    }

    @Override
    public int update(FriendlyLink friendlyLink) {
        return friendlyLinkMapper.update(friendlyLink);
    }

    @Override
    public FriendlyLink selectLinkUrl(FriendlyLink friendlyLink)  {
        return friendlyLinkMapper.selectLinkUrl(friendlyLink);
    }
}
